package com.yicong.ants.bean.video;

import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.TextView;

import com.cchao.simplelib.core.UiHelper;
import com.yicong.ants.R;
import com.yicong.ants.manager.UserManager;



/**
 * @author glj
 * @version 2021/3/3 0003
 */

public class VideoListBean {

    /**
     * uid : 10088088
     * vid : DB253834C2513D96E8AD85F7E75E0576
     * title : xxx
     * desc : 534534
     * face_img : 1231421
     * url : 42342
     * like_qty : 1
     * comment_qty : 5
     * forwarding_qty : 2
     * nickname : null
     * avatar : null
     * is_like : false
     * is_focus : false
     * like_text : 1
     */

    String uid;
    String vid;
    String title;
    String face_img;
    String url;
    int like_qty;
    int comment_qty;
    String comment_qty_text;
    String like_text;
    String forwarding_qty;
    String nickname;
    String avatar;
    boolean is_like;
    boolean is_focus;
    String forwarding_text;
    int foreign_type;
    int foreign_drawable;
    String foreign_desc;
    String foreign_link;

    public VideoListBean() {
    }

    public int getForeign_drawable() {
        // 外部链接类型：10=商城商品，11=商城店铺，20=景区列表，21=景区详情
        switch (foreign_type) {
            case 10: return R.drawable.video_route_product;
            case 11: return R.drawable.video_route_store;
            case 21: return R.drawable.video_route_scenic;
        }
        return R.drawable.video_route_scenic;
    }

    public String getForeign_desc() {
        // 外部链接类型：10=商城商品，11=商城店铺，20=景区列表，21=景区详情
        switch (foreign_type) {
            case 10: return "点击购买该商品";
            case 11: return "点击逛该店铺";
            case 20: return "景区列表";
            case 21: return "点击查看该景区";
        }
        return "foreign_desc";
    }

    public void update_like(TextView textView) {
        textView.setText(like_text);
        Drawable top;
        if (is_like) {
            top = UiHelper.getDrawable(R.drawable.tiktok_star_selected);
        } else {
            top = UiHelper.getDrawable(R.drawable.tiktok_star_normal);
        }
        textView.setCompoundDrawablesWithIntrinsicBounds(null, top, null, null);
    }

    public int isShowFocus() {
        if (UserManager.notLogin()) {
            return View.GONE;
        }
        if (UserManager.getUserId().equals(uid)) {
            return View.GONE;
        }
        if (!is_focus) {
            return View.VISIBLE;
        }
        return View.GONE;
    }

    public String getLike_text() {
        if (like_qty <= 0) {
            return "点赞";
        }
        return String.valueOf(like_qty);
    }

    public String getComment_qty_text() {
        if (comment_qty <= 0) {
            return "评论";
        }
        return String.valueOf(comment_qty);
    }

    public String getUid() {
        return this.uid;
    }

    public String getVid() {
        return this.vid;
    }

    public String getTitle() {
        return this.title;
    }

    public String getFace_img() {
        return this.face_img;
    }

    public String getUrl() {
        return this.url;
    }

    public int getLike_qty() {
        return this.like_qty;
    }

    public int getComment_qty() {
        return this.comment_qty;
    }

    public String getForwarding_qty() {
        return this.forwarding_qty;
    }

    public String getNickname() {
        return this.nickname;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public boolean is_like() {
        return this.is_like;
    }

    public boolean is_focus() {
        return this.is_focus;
    }

    public String getForwarding_text() {
        return this.forwarding_text;
    }

    public int getForeign_type() {
        return this.foreign_type;
    }

    public String getForeign_link() {
        return this.foreign_link;
    }

    public VideoListBean setUid(String uid) {
        this.uid = uid;
        return this;
    }

    public VideoListBean setVid(String vid) {
        this.vid = vid;
        return this;
    }

    public VideoListBean setTitle(String title) {
        this.title = title;
        return this;
    }

    public VideoListBean setFace_img(String face_img) {
        this.face_img = face_img;
        return this;
    }

    public VideoListBean setUrl(String url) {
        this.url = url;
        return this;
    }

    public VideoListBean setLike_qty(int like_qty) {
        this.like_qty = like_qty;
        return this;
    }

    public VideoListBean setComment_qty(int comment_qty) {
        this.comment_qty = comment_qty;
        return this;
    }

    public VideoListBean setComment_qty_text(String comment_qty_text) {
        this.comment_qty_text = comment_qty_text;
        return this;
    }

    public VideoListBean setLike_text(String like_text) {
        this.like_text = like_text;
        return this;
    }

    public VideoListBean setForwarding_qty(String forwarding_qty) {
        this.forwarding_qty = forwarding_qty;
        return this;
    }

    public VideoListBean setNickname(String nickname) {
        this.nickname = nickname;
        return this;
    }

    public VideoListBean setAvatar(String avatar) {
        this.avatar = avatar;
        return this;
    }

    public VideoListBean set_like(boolean is_like) {
        this.is_like = is_like;
        return this;
    }

    public VideoListBean set_focus(boolean is_focus) {
        this.is_focus = is_focus;
        return this;
    }

    public VideoListBean setForwarding_text(String forwarding_text) {
        this.forwarding_text = forwarding_text;
        return this;
    }

    public VideoListBean setForeign_type(int foreign_type) {
        this.foreign_type = foreign_type;
        return this;
    }

    public VideoListBean setForeign_drawable(int foreign_drawable) {
        this.foreign_drawable = foreign_drawable;
        return this;
    }

    public VideoListBean setForeign_desc(String foreign_desc) {
        this.foreign_desc = foreign_desc;
        return this;
    }

    public VideoListBean setForeign_link(String foreign_link) {
        this.foreign_link = foreign_link;
        return this;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof VideoListBean)) return false;
        final VideoListBean other = (VideoListBean) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$uid = this.getUid();
        final Object other$uid = other.getUid();
        if (this$uid == null ? other$uid != null : !this$uid.equals(other$uid)) return false;
        final Object this$vid = this.getVid();
        final Object other$vid = other.getVid();
        if (this$vid == null ? other$vid != null : !this$vid.equals(other$vid)) return false;
        final Object this$title = this.getTitle();
        final Object other$title = other.getTitle();
        if (this$title == null ? other$title != null : !this$title.equals(other$title))
            return false;
        final Object this$face_img = this.getFace_img();
        final Object other$face_img = other.getFace_img();
        if (this$face_img == null ? other$face_img != null : !this$face_img.equals(other$face_img))
            return false;
        final Object this$url = this.getUrl();
        final Object other$url = other.getUrl();
        if (this$url == null ? other$url != null : !this$url.equals(other$url)) return false;
        if (this.getLike_qty() != other.getLike_qty()) return false;
        if (this.getComment_qty() != other.getComment_qty()) return false;
        final Object this$comment_qty_text = this.getComment_qty_text();
        final Object other$comment_qty_text = other.getComment_qty_text();
        if (this$comment_qty_text == null ? other$comment_qty_text != null : !this$comment_qty_text.equals(other$comment_qty_text))
            return false;
        final Object this$like_text = this.getLike_text();
        final Object other$like_text = other.getLike_text();
        if (this$like_text == null ? other$like_text != null : !this$like_text.equals(other$like_text))
            return false;
        final Object this$forwarding_qty = this.getForwarding_qty();
        final Object other$forwarding_qty = other.getForwarding_qty();
        if (this$forwarding_qty == null ? other$forwarding_qty != null : !this$forwarding_qty.equals(other$forwarding_qty))
            return false;
        final Object this$nickname = this.getNickname();
        final Object other$nickname = other.getNickname();
        if (this$nickname == null ? other$nickname != null : !this$nickname.equals(other$nickname))
            return false;
        final Object this$avatar = this.getAvatar();
        final Object other$avatar = other.getAvatar();
        if (this$avatar == null ? other$avatar != null : !this$avatar.equals(other$avatar))
            return false;
        if (this.is_like() != other.is_like()) return false;
        if (this.is_focus() != other.is_focus()) return false;
        final Object this$forwarding_text = this.getForwarding_text();
        final Object other$forwarding_text = other.getForwarding_text();
        if (this$forwarding_text == null ? other$forwarding_text != null : !this$forwarding_text.equals(other$forwarding_text))
            return false;
        if (this.getForeign_type() != other.getForeign_type()) return false;
        if (this.getForeign_drawable() != other.getForeign_drawable()) return false;
        final Object this$foreign_desc = this.getForeign_desc();
        final Object other$foreign_desc = other.getForeign_desc();
        if (this$foreign_desc == null ? other$foreign_desc != null : !this$foreign_desc.equals(other$foreign_desc))
            return false;
        final Object this$foreign_link = this.getForeign_link();
        final Object other$foreign_link = other.getForeign_link();
        if (this$foreign_link == null ? other$foreign_link != null : !this$foreign_link.equals(other$foreign_link))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof VideoListBean;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $uid = this.getUid();
        result = result * PRIME + ($uid == null ? 43 : $uid.hashCode());
        final Object $vid = this.getVid();
        result = result * PRIME + ($vid == null ? 43 : $vid.hashCode());
        final Object $title = this.getTitle();
        result = result * PRIME + ($title == null ? 43 : $title.hashCode());
        final Object $face_img = this.getFace_img();
        result = result * PRIME + ($face_img == null ? 43 : $face_img.hashCode());
        final Object $url = this.getUrl();
        result = result * PRIME + ($url == null ? 43 : $url.hashCode());
        result = result * PRIME + this.getLike_qty();
        result = result * PRIME + this.getComment_qty();
        final Object $comment_qty_text = this.getComment_qty_text();
        result = result * PRIME + ($comment_qty_text == null ? 43 : $comment_qty_text.hashCode());
        final Object $like_text = this.getLike_text();
        result = result * PRIME + ($like_text == null ? 43 : $like_text.hashCode());
        final Object $forwarding_qty = this.getForwarding_qty();
        result = result * PRIME + ($forwarding_qty == null ? 43 : $forwarding_qty.hashCode());
        final Object $nickname = this.getNickname();
        result = result * PRIME + ($nickname == null ? 43 : $nickname.hashCode());
        final Object $avatar = this.getAvatar();
        result = result * PRIME + ($avatar == null ? 43 : $avatar.hashCode());
        result = result * PRIME + (this.is_like() ? 79 : 97);
        result = result * PRIME + (this.is_focus() ? 79 : 97);
        final Object $forwarding_text = this.getForwarding_text();
        result = result * PRIME + ($forwarding_text == null ? 43 : $forwarding_text.hashCode());
        result = result * PRIME + this.getForeign_type();
        result = result * PRIME + this.getForeign_drawable();
        final Object $foreign_desc = this.getForeign_desc();
        result = result * PRIME + ($foreign_desc == null ? 43 : $foreign_desc.hashCode());
        final Object $foreign_link = this.getForeign_link();
        result = result * PRIME + ($foreign_link == null ? 43 : $foreign_link.hashCode());
        return result;
    }

    public String toString() {
        return "VideoListBean(uid=" + this.getUid() + ", vid=" + this.getVid() + ", title=" + this.getTitle() + ", face_img=" + this.getFace_img() + ", url=" + this.getUrl() + ", like_qty=" + this.getLike_qty() + ", comment_qty=" + this.getComment_qty() + ", comment_qty_text=" + this.getComment_qty_text() + ", like_text=" + this.getLike_text() + ", forwarding_qty=" + this.getForwarding_qty() + ", nickname=" + this.getNickname() + ", avatar=" + this.getAvatar() + ", is_like=" + this.is_like() + ", is_focus=" + this.is_focus() + ", forwarding_text=" + this.getForwarding_text() + ", foreign_type=" + this.getForeign_type() + ", foreign_drawable=" + this.getForeign_drawable() + ", foreign_desc=" + this.getForeign_desc() + ", foreign_link=" + this.getForeign_link() + ")";
    }
}
